<template>
    <div>
    <h3>组件二</h3> 
    <button @click.prevent="btnClick">点击</button>
    </div>
</template>
           
<script>
import bus from "./bus.js"
export default{
    data () {
        return {
            msg:"我是组件二的数据"
        }
    },
    methods: {
        btnClick(){
            console.log("点击事件触发");
            bus.$emit('datatoone',this.msg)
        }
    }
             
}
</script>
<style lang="less" scoped>
            
</style>